import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";

function LanguageSwitcher() {
  const { t, i18n } = useTranslation();

  // 点击切换语言按钮，改变语言中英文来回切换 
  return (
    <div>
      {/* <h1>{t("language")}</h1> */}
      <button
        onClick={() => i18n.changeLanguage(i18n.language == "en" ? "zh" : "en")}
      >
        {t("language")}
      </button>
      {/* <p>{t("switchTheme")}</p>
      <p>{t("enter3DExhibition")}</p> */}
    </div>
  );
}

export default LanguageSwitcher;
